﻿#region Header
// Copyright (c) 2015 OPEN TONE, Inc.
// Released under the MIT license
// http://opensource.org/licenses/mit-license.php
#endregion
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenXmlLib.Excel;

namespace OpenXmlLibTest.Excel.Impl
{
	[TestClass()]
	public class WorkbookImplTest : AbstractExcelTestBase
	{
		/// <summary>
		/// Worksheetの取得
		/// </summary>
		[TestMethod()]
		public void TestGetWorksheet01()
		{
			IExcel excel = Open("WorkbookImplTest.TestGetWorksheet01.xlsx");
			Assert.IsNotNull(excel);

			IWorkbook workbook = excel.Workbook;
			// 大文字・小文字も一致する呼び出し
			IWorksheet worksheet = workbook.GetWorksheet("SheetName001");
			Assert.IsNotNull(worksheet);

			// 大文字・小文字を無視した呼び出し
			worksheet = workbook.GetWorksheet("SHEETNAME002");
			Assert.IsNotNull(worksheet);

			// 存在しないシート名を指定した呼び出し
			worksheet = workbook.GetWorksheet("SheetName003");
			Assert.IsNull(worksheet);
		}
	}
}
